<extend name="Public/base"/>

<block name="body">
<div class="tw-layout">
		<div class="tw-list-hd">
			配置管理 
		</div>
		 <div class="tw-list-top">
				<div class="tw-tool-bar">
	    		<a class="layui-btn layui-btn-normal" href="{:U('add')}">
	                <i class="tw-icon-plus-circle"></i> 添加
	            </a>
	            <a class="layui-btn" href="{:U('sort?group='.I('group'),'','')}" >
	                <i class="tw-icon-cogs"></i> 排序
	            </a>
	          </div>
	      	  <form action="__SELF__" method="get" id='frmSearch'>
                <div class="tw-search-bar">
			      <div class="search-form fr cf">
				      <div class="sleft">
						  <input type="text" name="name" class="search-input" value="{:I('name')}" placeholder="请输入配置名称">
						  <a type="submit" class="sch-btn" onclick="$('#frmSearch').submit();"><i class="btn-search"></i></a>
					  </div>
			      </div>
	           </div>
            </form>
	    </div>

	<div class="tw-list-wrap">
		<table class="tw-table tw-table-list tw-table-fixed">
				<colgroup>
		                    <col width="50">
		                    <col>
		                    <col width="25%">
		                    <col width="100">
		                    <col width="100">
		                    <col width="200">
		       </colgroup>
			<thead>
				<tr>
					<th>ID</th>
					<th>名称</th>
					<th>标题</th>
					<th>分组</th>
					<th>类型</th>
					<th>操作</th>
				</tr>
			</thead>
			<tbody>
				<notempty name="list">
				<volist name="list" id="config">
					<tr>
						<td>{$config.id}</td>
						<td class="text-left">{$config.name}</td>
						<td class="text-left">{$config.title}</td>
						<td>{$config.group|get_config_group}</td>
						<td>{$config.type|get_config_type}</td>
						<td>
							<a class="layui-btn layui-btn-normal"  href="{:U('edit?id='.$config['id'])}">
			                    <i></i> 修改
			                </a>
			                <a class="layui-btn layui-btn-danger" onclick="javascript:recycle({$config['id']}, '确认删除?!此步骤无法恢复!')">
                                <i></i> 删除
                            </a>
						</td>
					</tr>
				</volist>
				<else/>
				<td colspan="6" class="text-center"> aOh! 暂时还没有内容! </td>
				</notempty>
			</tbody>
		</table>
		<!-- 分页 -->
	    <div class="page">
	        {$_page}
	    </div>
	</div>
</div>
</block>

<block name="script">
<script type="text/javascript">
$(function(){
	//点击排序
	$('.list_sort').click(function(){
		var url = $(this).attr('url');
		var ids = $('.ids:checked');
		var param = '';
		if(ids.length > 0){
			var str = new Array();
			ids.each(function(){
				str.push($(this).val());
			});
			param = str.join(',');
		}

		if(url != undefined && url != ''){
			window.location.href = url + '/ids/' + param;
		}
	});
});
</script>
</block>